import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    // 首页
    {
      path: '/',
      name: 'Home',
      component: () => import('@/views/Home')
    },
    //博客详情页
    {
      path: '/details',
      name: 'Details',
      component: () => import('@/views/Details')
    },
    //博客创作页面
    {
      path: "/editor",
      name: "Editor",
      component: () => import('@/views/Editor'),
      meta:{
        auth:true
      }
    },
    //个人主页
    {
      path: '/personalblog',
      name: 'PersonalBlog',
      component: () => import('@/views/PersonalBlog'),
      meta:{
        auth:true
      }
    },
    {
      path: '/dashBoard',
      name: 'DashBoard',
      component: () => import('@/views/DashBoard'),
      meta:{
        auth:true
      }
    },
    {
      path: '/404',
      name: 'NotFound',
      component: () => import('@/views/NotFound.vue')
    },
    {
      path: '*',
      redirect: "/404"
    },
  ]
})